<template>
	<view class="feedback">
		<textarea v-model="content" placeholder="请输入留言内容" />
		<view class="feedimg">
			<fjjImages :pageImgList="wximg" @getwximgurl="getwximgurl" :type="geturl[0]" :imgCount="3" @addImg="editParkImg"
				@deleteImg="deleteImg"></fjjImages>
		</view>
		<view class="btn" @click="FeedbackAdd">
			提交
		</view>
		<view class="list" @click="toFeedback"></view>
	</view>
</template>

<script>
	import { FeedbackAdd } from '../../api/user.js'
	import fjjImages from '../../components/fjj-images/fjj-images.vue';
	export default {
		components: {
			fjjImages
		},
		data() {
			return {
				content: '',
				geturl: ['getwximgurl'],
				wximg: [],
				wx_img:''

			}
		},
		onLoad() {
			
		},
		methods: {
			editParkImg(currentTempFilePath) {},
			deleteImg(index) {},
			FeedbackAdd(){
				FeedbackAdd({
					voucher_url : this.wximg,
					content:this.content	
				}).then(res=>{
					uni.showToast({
						title:res.message,
						icon:'none'
					})
					setTimeout(()=>{
						if(res.status == 1){
							uni.redirectTo({
								url:'/pages/addFeedback/index'
							})
						}
					},1000)
				})
			},
			getwximgurl(e) {
				this.wx_img = e
				this.wximg = e
				// console.log(this.wximg)
			},
			toFeedback(){
				uni.navigateTo({
					url:'/pages/Feedback/index'
				})
			}
		}
	}
</script>

<style lang="scss">
	.feedback {
		padding-top: 30px;
		textarea {
			width: 80%;
			background: #fff;
			border-radius: 8px;
			margin: 0 auto;
			padding: 5%;
			height: 100px;
			margin-bottom: 30px;
		}
		.feedimg{
			width: 90%;
			margin-left: 5%;
		}
	}
	.list{
		    position: absolute;
		    width: 44px;
		    height: 44px;
		    top: -44px;
		    z-index: 999;
		    right: 0;
	}
</style>
